CREATE TABLE Smart_documento_tiposervicio
(
	sm_scdoctiposervicio INTEGER NOT NULL AUTO_INCREMENT,
	sm_scdocumentos INTEGER NOT NULL,
	sm_sctiposervicio INTEGER NOT NULL,
	sm_fhingreso DATE NOT NULL,
	sm_fhmodificacion DATE NOT NULL,
	sm_fhretiro DATE,
	sm_cousuario VARCHAR(150) NOT NULL,
	sm_scempresa INTEGER NOT NULL,
	sm_scclaseubicacion INTEGER NOT NULL,
	sm_sccondicionjuridica INTEGER NOT NULL,
	sm_snobligatorio CHAR(2) NOT NULL,
	PRIMARY KEY (sm_scdoctiposervicio),
	KEY (sm_scdocumentos)
) 
;


ALTER TABLE Smart_documento_tiposervicio ADD CONSTRAINT FK_Smart_documento_tiposervicio_Smart_datos_maestros 
	FOREIGN KEY (sm_scdocumentos) REFERENCES Smart_datos_maestros (sm_scdatmaestro)
;

